import { GCellRenderer } from "../../../../../com/mui/controls/GCellRenderer";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { EliteTowerMapData } from "../config/info/EliteTowerMapData";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../../extend/language/Language";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class EliteMapStateCellRenderer
    
    export  class EliteMapStateCellRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            this._bg = GlobalClass.getScaleBitmap(ImagesConst.ButtonGreen_overSkin, new Object /* flash.geom.Rectangle */(19, 9, 23, 1));
            this._bg.width = 120;
            this._bg.height = 20;
            this._bg.x = 0;
            this.addChild(this._bg);
            this._nameLabel = ObjCreate.createGTextField("", 0, 0, 120, 20, this, GlobalStyle.getTextFormatCenter(GlobalStyle.textFormat1));
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            var loc1=arg1 as EliteTowerMapData;
            if (loc1) 
            {
                if (loc1.completed) 
                {
                    this._bg.bitmapData = GlobalClass.getBitmapData(ImagesConst.ShortcutBtn_upSkin);
                    this._bg.setSize(120, 20);
                    this._nameLabel.htmlText = HTMLUtil.addColor(Language.getStringByParam(60614, loc1.name), "#737977");
                }
                else 
                {
                    this._bg.bitmapData = GlobalClass.getBitmapData(ImagesConst.ButtonGreen_overSkin);
                    this._bg.setSize(120, 20);
                    this._nameLabel.htmlText = HTMLUtil.addColor(Language.getStringByParam(60615, loc1.name), "#FFFF00");
                }
            }
            return;
        }

        /* internal */ /* var */_bg: ScaleBitmap;

        /* internal */ /* var */_nameLabel: GTextFiled;
    }
